﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ViewDetailArchive : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		SE6.User curUsr = SessionMan.GetLoginUser();
		Int32 id;
		if (Int32.TryParse((String)Request.QueryString["id"],out id) && id>=0)
		{
			Archive curAr=DAMS.DataAccess.GetArchiveDescription(id);
			if (curAr!=null)
			{
				Int32 point;
				if (Int32.TryParse(Request.Form["point"],out point))
				{
					String description = (String)Request.Form["dpt"];
					String category = (String)Request.Form["cat"];
					curAr.Update(point, description, category);
					if (DAMS.DataAccess.Update(curAr))
						feedBack.Text = "更新档案信息成功!";
					else
					{
						feedBack.Text="更新档案信息失败!";
						feedBack.CssClass = "hint red";
					}

					//PostBack

				}
				arDetail.InnerHtml = curAr.Render();
				navMenu.InnerHtml = GUI.NavMenu(PageClass.DetailArchive);
				return;
			}
		}
		SessionMan.SaveResult("当前档案不存在，或已被删除！");
		Response.Redirect("Result.aspx");
    }
}
